<?php

namespace App\Http\Middleware;

use Closure;

class LoginEnterprisesMiddleware
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
       // session(['masterarr.1' => 10102]);
       // session(['masterarr.0' => 10101]);
    // if(empty(session('masterarr')))
    // {

    // }
    // $request -> eid $request -> id
    // dd($request -> eid);
    if(!empty(session('master['.$request -> eid.']')) || !empty(session('master['.$request -> id.']')))
    {
        return $next($request);
    }
    return redirect('/home/enterprise/reglogin');
    // var_dump(session('masterarr'));
       // session(['masterarr' => 10102]);
       // session(['masterarr.0' => 10101]);
        // var_dump(session('masterarr'));

        // dd($request -> all());
        
    }
}
